#include "treeview.h"

TreeView::TreeView(QWidget *parent)
    : QDialog(parent)
{
	ui.setupUi(this);
    ui.treeWidget->setColumnCount(2);
    QStringList headers;
    headers << tr("Name") << tr("Email");
    ui.treeWidget->setHeaderLabels(headers);
}

TreeView::~TreeView()
{
// Delete the list here
}

void TreeView::SetList(QList<QStringList *> List)
{
	QList<QTreeWidgetItem *> ItemList;

	for (int i = 0; i < List.count(); ++i)
	{
		ItemList.append(new QTreeWidgetItem((QTreeWidget*) ui.treeWidget, *List[i]));
	}
//	ui.treeWidget->insertTopLevelItems(0, ItemList);
}
